<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>

<body>
    <div class="app">
        <h1>当前值为{{a}}</h1>
        <button @click="aplus">加1</button>
        <div v-if="a===1">Angular</div>
        <div v-else-if="a===2">React</div>
        <!-- 打断if -->
        <!-- <div>@</div> -->
        <div v-else-if="a===3">Vue</div>
        <div v-else>哈哈哈</div>

        <br><br>
        <!-- template会被删除 与v-if配合 -->
        <template v-if="a===2||a===6">
            <h2>1</h2>
            <h2>2</h2>
            <h2>3</h2>
        </template>
    </div>
    <script>
        const vm = new Vue({
            data: {
                a: 1
            },
            methods: {
                aplus() {
                    this.a++
                }
            }
        })
        vm.$mount('.app')
    </script>
</body>

</html>